// 设置响应头的中间件
module.exports = async (context, next) => {
  const contentType = 'application/json; charset=utf-8'
  context.set('Content-Type', contentType)

  // 解决跨域
  context.set("Access-Control-Allow-Origin", "*")
  context.set("Access-Control-Allow-Methods", "OPTIONS, GET, PUT, POST, DELETE")
  await next()
}